package cn.com.mds.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.com.mds.entity.User;
import cn.com.mds.service.UserService;

/**
* @Description: TODO(用一句话描述该文件做什么) 
* @author Y.Jin
* @date 2017年2月15日 下午5:33:22
 */

@RestController
@RequestMapping(value="user")
public class UserController {

	@Autowired
	private UserService service;
	
	public UserController()
	{
		System.out.println("初始化UserController");
	}
	
	@RequestMapping(value="add")
	public void add(){
		User u = new User();
		u.setPwd("13465");
		u.setUsername("UYT");
		service.save(u);
	}
	
	@RequestMapping(value="getlist")
	public void getlist(){
		String content = service.getList().toString();
		System.out.println("查询到的内容：" + content);
	}
	
}
